﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace aier.dataaccess.model
{
    [XrmEntity("new_reservation", "new_reservationid")]
    public class Reservation:BaseModel
    {
        [XrmFieldMapping("new_reservationid", XrmAttributeType.UniqueIdentifier)]
        public Guid new_reservationid { get; set; }

        /// <summary>
        /// 转诊记录ID
        /// </summary>
        [XrmFieldMapping("new_recommend", XrmAttributeType.EntityReference, true)]
        [XrmReferenceType("new_recommend", default(string))]
        public Nullable<System.Guid> new_recommend { get; set; }

        /// <summary>
        /// 数据来源
        /// 1:筛查客户名单同步，2:导诊工具，3:预约接口,4:批量预约,5:网医新增患者接口,6:商务通,7:呼叫中心,8:预约平台
        /// </summary>
        [XrmFieldMapping("new_datasource", XrmAttributeType.XrmOptionSetValue, true)]
        public int? new_datasource { get; set; }

        /// <summary>
        ///项目
        /// </summary>
        [XrmFieldMapping("new_contnt", XrmAttributeType.XrmOptionSetValue, true)]
        public int? new_contnt { get; set; }


        /// <summary>
        /// 筛查项目
        /// </summary>
        [XrmFieldMapping("new_new_screenitem", XrmAttributeType.EntityReference, true)]
        [XrmReferenceType("new_screenitem", default(string))]
        public Nullable<System.Guid> new_new_screenitem { get; set; }

        /// <summary>
        /// 负责人id
        /// </summary>
        [XrmFieldMapping("ownerid", XrmAttributeType.EntityReference, true)]
        [XrmReferenceType("systemuser", default(string))]
        public System.Guid ownerId { get; set; }

        /// <summary>
        /// 社保,医保类型
        /// </summary>
        [XrmFieldMapping("new_insurancetype", XrmAttributeType.XrmOptionSetValue, true)]
        public int? new_insurancetype { get; set; }

        /// <summary>
        /// 科室
        /// </summary>
        [XrmFieldMapping("new_department", XrmAttributeType.EntityReference, true)]
        [XrmReferenceType("new_department", default(string))]
        public Guid? new_department { get; set; }

        /// <summary>
        /// 潜在患者
        /// </summary>
        [XrmFieldMapping("new_lead", XrmAttributeType.EntityReference, true)]
        [XrmReferenceType("lead", default(string))]
        public Guid? new_lead { get; set; }


        /// <summary>
        /// 年龄
        /// </summary>
        [XrmFieldMapping("new_age", XrmAttributeType.Int, true)]
        public int? new_age { get; set; }

        /// <summary>
        /// 社保卡号/医保卡号
        /// </summary>
        [XrmFieldMapping("new_insuranceid", XrmAttributeType.String, true)]
        public string new_insuranceid { get; set; }

        /// <summary>
        /// 手机号
        /// </summary>
        [XrmFieldMapping("new_mobile", XrmAttributeType.String, true)]
        public string new_mobile { get; set; }

        /// <summary>
        /// QQ
        /// </summary>
        [XrmFieldMapping("new_qq", XrmAttributeType.String, true)]
        public string new_qq { get; set; }

        /// <summary>
        /// 微信号
        /// </summary>
        [XrmFieldMapping("new_wechat", XrmAttributeType.String, true)]
        public string new_wechat { get; set; }

        /// <summary>
        /// 预约日期
        /// </summary>
        [XrmFieldMapping("new_reservationdate", XrmAttributeType.DateTime, true)]
        public DateTime? new_reservationdate { get; set; }

        /// <summary>
        /// 到院日期
        /// </summary>
        [XrmFieldMapping("new_hospitalizeddate", XrmAttributeType.DateTime, true)]
        public DateTime? new_hospitalizeddate { get; set; }

        /// <summary>
        /// 时间段
        /// </summary>
        [XrmFieldMapping("new_timebucket", XrmAttributeType.XrmOptionSetValue, true)]
        public int? new_timebucket { get; set; }

        /// <summary>
        /// 医院
        /// </summary>
        [XrmFieldMapping("new_hospital", XrmAttributeType.EntityReference, true)]
        [XrmReferenceType("new_hospital", default(string))]
        public Guid? new_hospital { get; set; }

        /// <summary>
        /// 医生
        /// </summary>
        [XrmFieldMapping("new_user", XrmAttributeType.EntityReference, true)]
        [XrmReferenceType("new_user", default(string))]
        public Guid? new_user { get; set; }

        /// <summary>
        /// 是否复诊
        /// </summary>
        [XrmFieldMapping("new_isreview", XrmAttributeType.Boolean, true)]
        public bool? new_isreview { get; set; }

        /// <summary>
        /// 来源方式
        /// </summary>
        [XrmFieldMapping("new_source", XrmAttributeType.XrmOptionSetValue, true)]
        public int? new_source { get; set; }

        /// <summary>
        /// 市场活动
        /// </summary>
        [XrmFieldMapping("new_campaign", XrmAttributeType.EntityReference, true)]
        [XrmReferenceType("new_campaign", default(string))]
        public Guid? new_Campaign { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [XrmFieldMapping("new_remark", XrmAttributeType.String, true)]
        public string new_remark { get; set; }

        /// <summary>
        /// 筛查
        /// </summary>
        [XrmFieldMapping("new_screen", XrmAttributeType.EntityReference, true)]
        [XrmReferenceType("new_screen", default(string))]
        public Guid? new_screen { get; set; }

        /// <summary>
        /// 性别
        /// </summary>
        [XrmFieldMapping("new_gender", XrmAttributeType.XrmOptionSetValue, true)]
        public int? new_gender { get; set; }

        /// <summary>
        /// 到院确认0、未到院；1、已到院
        /// </summary>
        [XrmFieldMapping("new_istohospital", XrmAttributeType.Boolean, true)]
        public bool? new_istohospital { get; set; }

        /// <summary>
        /// 未到院原因
        /// 100000000、其他；
        /// 100000001、价格太高；
        /// 100000002、取消预约；
        /// 100000003、身体恶化或痊愈；
        /// 100000004、时间未到；
        /// 100000005、他院就诊；
        /// 100000006、位置太远；
        /// 100000007、沟通无法继续；
        /// </summary>
        [XrmFieldMapping("new_wedaore", XrmAttributeType.XrmOptionSetValue, true)]
        public int? new_wedaore { get; set; }

        /// <summary>
        /// 可术情况
        /// 100000000、双眼可术；
        /// 100000001、左眼可术；
        /// 100000002、右眼可术；
        /// 100000003、双眼不可手术；
        /// </summary>
        [XrmFieldMapping("new_operatestus", XrmAttributeType.XrmOptionSetValue, true)]
        public int? new_operatestus { get; set; }

        /// <summary>
        /// 是否签订手术协议0、未签；1、已签；
        /// </summary>
        [XrmFieldMapping("new_issign", XrmAttributeType.Boolean, true)]
        public bool? new_issign { get; set; }

        /// <summary>
        /// 是否手术0、未手术；1、已手术；
        /// </summary>
        [XrmFieldMapping("new_isoperate", XrmAttributeType.Boolean, true)]
        public bool? new_isoperate { get; set; }
        /// <summary>
        /// 未手术原因
        /// 100000000、价格高；
        /// 100000001、他院就诊；
        /// 100000002、其他；
        /// 100000003、待定；
        /// </summary>
        [XrmFieldMapping("new_nooperatereason", XrmAttributeType.XrmOptionSetValue, true)]
        public int? new_nooperatereason { get; set; }

        /// <summary>
        /// 负责人
        /// </summary>
        [XrmFieldMapping("ownerid", XrmAttributeType.EntityReference, true)]
        [XrmReferenceType("systemuser", default(string))]
        public Guid? ownerid { get; set; }

    }
}
